package com.haishen.usercenter.service.impl;

import com.haishen.usercenter.model.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
* @author haiShen
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-10-13 20:33:58
*/
public interface UserService extends IService<User> {
    
    /**
     * 用户注册
     * 
     * @param userAccount 用户账户
     * @param userPassword 账户密码
     * @param checkPassword 校验密码                    
     * @param planetCode 用户编号
     * @return 新用户 id
     */
    
    long userRegister(String userAccount, String userPassword, String checkPassword,String planetCode);
    
    /**
     * 用户登录
     * 
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param request 发送请求
     * @return 脱敏后的用户信息 User
     */
    
    User login(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 用户脱敏
     *
     * @param originUser 原始账户
     * @return 脱敏后的用户信息 User
     */
    User getSafetyUser(User originUser);

    /**
     * 退出登录
     *
     * @param request 发送请求
     * @return 
     */
    int userLogout(HttpServletRequest request);

}
